<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/displaytag-11.tld" prefix="display"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>untitled</title>
    <link href="../../css/jdeveloper.css" rel="stylesheet" media="screen"/>
    <link href="<%= request.getContextPath() + "/css/bloques.css" %>" rel="stylesheet" type="text/css">
    <link href="<%= request.getContextPath() + "/css/table.css" %>" rel="stylesheet" type="text/css">
  <script language="javascript">
    function validar(){
      if(document.NuevoGrupoFamiliar.nombre.value == "" || document.NuevoGrupoFamiliar.codeParentesco.value=="" ){
        alert("Deben ser llenados todos los campos");
        return false;
      }else{
        document.NuevoGrupoFamiliar.submit();
      }
    }
  </script>
  </head>
  <body>
    <table width="80%"  border="0" cellspacing="0" cellpadding="0" widtd="100%" align="center">
       
      <tr align="left"> 
       <td height="25" colspan="12" align="center" class="titulosenblanco"> 
        <p>
         <STRONG>Nuevo Grupo Familiar</STRONG>
        </p>
        <p>&nbsp; </p>
       </td>
       </tr>
  
       <html:form action="/beneficiarios/GuardarGrupoFamiliar.do"  method="get" focus="nombre" type="com.cs.beneficios.web.form.NuevoGrupoFamiliarForm">
        <tr align="left">
         <td height="25" colspan="12" class="titulosenblanco">   
          <table width="100%" border="0" cellspacing="3" cellpadding="3">
          
           <%
           String strMessageErrorNGF = (String)session.getAttribute("msgErrorNGF");
           if(strMessageErrorNGF != null)
           {
            session.removeAttribute("strMessageErrorNGF");
           %>
            <tr>
                <td align="center" colspan="3">
                  <font class="celdatabla"><STRONG><%=strMessageErrorNGF%></STRONG></font>
                </td>
            </tr>
            <tr>
              <td>
                <P>&nbsp;</P>
              </td>
            </tr>
           <%
           }
         %>
          
          <logic:iterate id="bene" length="1" name="bene">
           <tr>
            <td width="3%">&nbsp;</td>
            <td width="39%" class="celdatabla"><strong>Beneficiario cabeza del grupo:</strong>  
            </td>
            <td width="56%">
            
              <div class="form">
                <bean:write name="bene" property="nombre1" />
                <bean:write name="bene" property="nombre2" />
                <bean:write name="bene" property="primerApellido" />
                <bean:write name="bene" property="segundoApellido" />
              </div>
              <input type="hidden" name="code" value="<bean:write name="bene" property="code" />"/>
            
            </td>
            <td width="3%">&nbsp;</td>
           </tr>
           <tr>
            <td width="3%">&nbsp;</td>
            <td width="39%" class="celdatabla"><strong>Nombre del grupo familiar:</strong></td>
            <td width="56%">
              <input type="text" class="form" name="nombre" value="GF-<bean:write name="bene" property="numeroDocumento" />"/>    
            </td>
            <td width="3%">&nbsp;</td>
           </tr>
           <tr>
             <td width="3%">&nbsp;</td>
             <td width="39%" class="celdatabla">
               <strong>Rol dentro del grupo</strong>: 
             </td>
             <td width="56%">
                <%
                  String strCode = (String)session.getAttribute("codeParentesco");
                %>
               <html:select property="codeParentesco" value="<%=strCode%>" styleClass="form">
                        <html:option value="">Seleccione un rol</html:option>
                        <html:options name="parentescos" labelName="code" labelProperty="descVflex" property="code" collection="parentescos" />
                </html:select>
             </td>
             <td width="3%">&nbsp;</td>
           </tr>
           <tr>
             <td width="3%" colspan="4">&nbsp;</td>
           </tr>
           <tr>
             <td width="3%" colspan="4">
               <DIV align="center">&nbsp;&nbsp;&nbsp;
               <input type="hidden" name="origen" value="nuevo"/>
               <input type="button" value="Guardar" onclick="validar();"/></DIV>
             </td>
           </tr> 
           </logic:iterate>
           </table>
          </td>
        </tr>  
       </html:form>  
       
      </table>

  </body>
</html>
